//导航滑块
function scrollLeftBox(scrollClassName, className, isAnimate = false) {
	// 获取屏幕宽度
	var cWidth
	if (document.compatMode && document.compatMode != 'BackCompat') {
		cWidth = document.documentElement.clientWidth
	} else if (document.body) {
		cWidth = document.body.clientWidth
	}
	// 1.当前点击的li距离屏幕左边的距离
	var liOffsetLeft = $(scrollClassName + ' ' + className + ' li .a.active').offset().left
	// 2.li的宽度的一半
	var liWidthHalf = $(scrollClassName + ' ' + className + ' li .a.active').width() / 2
	// 4.当前滚动条滚动的距离
	var scrollLeftWidth = $(scrollClassName).scrollLeft()
	if (isAnimate) {
		$(scrollClassName).animate({
			scrollLeft: scrollLeftWidth + (liOffsetLeft - cWidth / 2) + liWidthHalf
		}, 300)
	} else {
		$(scrollClassName).scrollLeft(scrollLeftWidth + (liOffsetLeft - cWidth / 2) + liWidthHalf)
	}
}

// 获取链接中的参数
function GetRequest() {
	var url = window.location.search;
	var theRequest = new Object();
	if (url.indexOf("?") != -1) {
		var str = url.substr(1);
		strs = str.split("&");
		for (var i = 0; i < strs.length; i++) {
			theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
		}
	}
	return theRequest;
}

//app设置全局 自适应尺寸
function setRem(){
	var html = document.getElementsByTagName('html')[0];
	if(html){
	    var w = window.innerWidth;
	    var fontSize = (w>750?750:w)/750 * 100;
	    html.style.fontSize = fontSize + 'px';
	}
	window.onload = function(){
	    window.onresize = function(){
	        var w = window.innerWidth;
	        var fontSize = (w>750?750:w)/750 * 100;
	        html.style.fontSize = fontSize + 'px';
	    }
	};
}
function publicBnner(){
	new Swiper('.public_banner_box', {
		pagination: {
			el: '.swiper-pagePublicBanner',
			clickable: true
		}
	})
}

$(function(){
	setRem()
	publicBnner()
})